package com.example.hospital.api.controller.form;

import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author luojing
 * @date 2024/5/15 1:00
 */
@Data
public class SearchMisUserByPageForm {
    @Pattern(regexp = "^[a-zA-Z\\u4e00-\\u9fa5]{1,20}$", message = "username内容不正确")
    private String username;

    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,20}$", message = "name内容不正确")
    private String name;

    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,20}$", message = "tel内容不正确")
    private String tel;


//    @NotNull(message = "status不能为空")
//    @Range(min = 1, max = 3, message = "status内容不正确")
//    private Byte status;

    @NotNull(message = "page不能为空")
    @Min(value = 1, message = "page不能小于1")
    private Integer page;

    @NotNull(message = "length不能为空")
    @Range(min = 10, max = 50, message = "length内容不正确")
    private Integer length;
}
